package com.hs.hlw.credit.system.web.controller.api;

import com.hs.hlw.credit.system.business.dto.ResponseDto;
import com.hs.hlw.credit.system.business.service.FieldService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * FieldController
 * @author zhb
 * @date 2018/11/19
 */
@RestController
@RequestMapping("/api/field")
public class FieldController {
    private @Autowired FieldService fieldService;

    @GetMapping(path = "getFieldListByTable")
    @ApiOperation(value = "获取指定数据库表下的字段", notes = "获取指定数据库表下的字段")
    public ResponseDto getFieldListByTable(@RequestParam @ApiParam(value = "表ID", required = true) String tableId) {
        return fieldService.getFieldListByTable(tableId);
    }
}